[codex] Refactor desktop settings Effect services#3188
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityVerdict: Approved Pure refactor of desktop settings Effect services that improves error class structure and message detail without changing runtime behavior. Error classes migrated to Schema.TaggedErrorClass with richer context fields, and You can customize Macroscope's approvability policy. Learn more. |
50b4ddb to
3236e4a
Compare
Dismissing prior approval to re-evaluate 3236e4a
3236e4a to
a17e8af
Compare
Dismissing prior approval to re-evaluate a17e8af
a17e8af to
d83af36
Compare
Dismissing prior approval to re-evaluate d83af36
554e0ac to
d84fb7e
Compare
Dismissing prior approval to re-evaluate d84fb7e
d84fb7e to
6ec2bb6
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
6ec2bb6 to
c9ad561
Compare
Dismissing prior approval to re-evaluate c9ad561
Co-authored-by: codex <codex@users.noreply.github.com>
c9ad561 to
037db6d
Compare
Dismissing prior approval to re-evaluate 037db6d
Summary
Context.Servicetags.Service["Service"]types.makevalues andlayerconstants for all four services without synthetic wrappers.cause.Scope
The final diff is limited to the desktop settings and connection-catalog services plus focused error-classification tests. There are no orchestration, MCP, or server-exposure changes.
Validation
vp check— passed; 20 pre-existing unrelated warningsvp run typecheck— passedgit diff --check origin/main...HEAD— passedNote
Low Risk
Refactor is localized to desktop persistence error typing and layer wiring; persistence and encryption behavior are preserved and covered by expanded tests.
Overview
Refactors four desktop Effect services (
DesktopAppSettings,DesktopClientSettings,DesktopSavedEnvironments,DesktopConnectionCatalogStore) so failures are typed, stage-specific errors instead of generic read/write wrappers around platform or schema causes.Error model:
Data.TaggedErrorbecomesSchema.TaggedErrorClasswith structured fields—operation,path/catalogPath/registryPath, optionalenvironmentIdorfield—and stable user-facingmessagestrings that do not echo raw underlying errors. JSON envelope failures are split from filesystem reads (*DocumentDecodeErrorvs*ReadError); encrypted payload/base64 issues use dedicated decode errors. Secret-related messages are built so invalid blob content (e.g.%%%) is not leaked.Service shape: Standalone
*Shapeinterfaces are removed; contracts live on eachContext.Servicetag. Layers are built via exportedmake+Layer.effect(..., make); tests and mocks useService["Service"]where needed.Behavior: Persistence, encryption, legacy migration, and settings semantics are unchanged; tests are expanded to assert error class, operation, paths, and message content for read/write/decode/migration paths.
Reviewed by Cursor Bugbot for commit 037db6d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Refactor desktop settings services to use structured, tagged error classes
DesktopAppSettings,DesktopClientSettings,DesktopSavedEnvironments, andDesktopConnectionCatalogStorewithSchema.TaggedErrorClassvariants that include structured fields:operation,path/registryPath/catalogPath, andcause.encode-document,create-directory,write-temporary-file,replace-settings-file) to distinct operation literals on the error, providing stable messages that don't echo underlying error content.DesktopSavedEnvironmentsReadErrorvsDesktopSavedEnvironmentsDocumentDecodeError).makefactory function; method signatures and success-path behavior are unchanged.Macroscope summarized 037db6d.